package com.it.enums;

/**
 * @author TBH
 * @date 2025-05-08 17:02:04
 * @desc 微信返回的性别
 */
public enum WxGenderEnums {
    UNKNOWN(0, "未知"),
    MAN(1, "男"),
    WOMAN(2, "女");

    private final int code;
    private final String sex;

    WxGenderEnums(int code, String sex) {
        this.code = code;
        this.sex = sex;
    }

    public static String getSex(int code) {
        String sex = null;
        for (WxGenderEnums value : WxGenderEnums.values()) {
            if (value.code == code) {
                sex = value.sex;
                break;
            }
        }
        return sex;
    }
}
